<?php use_helper('Date'); ?>
<?php $prj_id = $sf_user->getAttribute('prj_id', -1) ?>
<h1>Evénements</h1>

<div class="action">
<?php echo link_to('Vue par date', 'evenement/index', array('class' => 'action')) ?>
&nbsp;
<?php echo link_to('Nouvel événement', "evenement/new", array('class' => 'action')) ?>
</div>

<h2>Projet</h2>
	<table class="liste">
		<tbody>
		<?php
			foreach ($evenement_list as $evenement) {
				echo '<tr>';
				echo '<td class="action">';
				echo '<a href="'. url_for('evenement/edit?evt_id='.$evenement->getEvtId()) .'">'. image_tag('edit.png') .'</a>';
				echo "</td>\n";

				echo '<td>'. format_date($evenement->getEvtDate(), 'dd/MM/yyyy') .'</td>';
				echo '<td>'. $evenement->getEvtEvenement() .'</td>';
				echo '</tr>';
			}
		?>
		</tbody>
	</table>


<?php foreach ($categorie_list as $categorie): ?>
	<?php if ($categorie->hasEvenements()): ?>
	<h2><?php echo $categorie->getCatCategorie() ?></h2>
	<table class="liste">
		<tbody>
		<?php
			foreach ($categorie->getEvenements() as $evenement) {
				echo '<tr>';
				echo '<td class="action">';
				echo '<a href="'. url_for('evenement/edit?evt_id='.$evenement->getEvtId()) .'">'. image_tag('edit.png') .'</a>';
				echo "</td>\n";

				echo '<td>'. format_date($evenement->getEvtDate(), 'dd/MM/yyyy') .'</td>';
				echo '<td>'. $evenement->getEvtEvenement() .'</td>';
				echo '</tr>';
			}
		?>
		</tbody>
	</table>
	<?php endif; ?>
<?php endforeach; ?>
